import { NextFunction, Request, Response } from 'express';

export function appFnMiddleware(
  req: Request,
  res: Response,
  next: NextFunction,
) {
  console.group('appFnMiddleware in');
  console.log('in req', req.baseUrl);
  console.log('in res', JSON.stringify(res.getHeaders()));
  console.groupEnd();
  const start = performance.now();
  res.on('finish', () =>
    console.log('appFnMiddleware run time,', performance.now() - start),
  );
  next();
}
